﻿@section css{
    <style type="text/css">
        .innertb {
            border: none;
        }

            .innertb tr td {
                border: none;
            }

        .orderfeeborder {
            border: solid 1px #aaa;
        }

            .orderfeeborder tr {
                width: 100%;
                text-align: center;
            }

                .orderfeeborder tr td {
                    text-align: center;
                    border: solid 1px #aaa;
                }

        .btnborder {
            border: solid 1px #aaa;
        }

            .btnborder tr {
                width: 100%;
                text-align: center;
            }

            .btnborder table tr td {
            }

        .ordermainborder {
            border: solid 1px #aaa;
        }

            .ordermainborder tr {
                width: 100%;
                text-align: center;
            }

                .ordermainborder tr td {
                    text-align: center;
                    border: solid 1px #aaa;
                }

        .orderdetailborder {
            border: solid 1px #aaa;
        }

            .orderdetailborder tr {
                width: 100%;
                text-align: center;
            }
    </style>
}
@section js{}
<div class="mini-fit">
    <div style="width: 100%; height: 100%; padding: 0px 0px 0px 0px">
        <div style="width: 100%; height: auto">
            <form id="orderMain" name="orderMain" method="post">
                <input class="mini-hidden" id="OrderID" name="OrderID" value="" />
                <input class="mini-hidden" id="SubCompanyID" name="SubCompanyID" value="@(new Guid().ToString())" />
                <input class="mini-hidden" id="Destination" name="Destination" value="" />
                <input class="mini-hidden" id="GoodsNum" name="GoodsNum" value="" />
                <input class="mini-hidden" id="ReceiverID" name="ReceiverID" value="" />
                <input class="mini-hidden" id="SenderID" name="SenderID" value="" />
                <input class="mini-hidden" id="ManualNo" name="ManualNo" value="" />
                <table style="width: 100%;" class="ordermainborder">
                    <tr>
                        <td style="width: 8%">
                            <span>开票日期</span>
                        </td>
                        <td>
                            <input id="TicketCreateDate" name ="TicketCreateDate" class="mini-datepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" width="100%" />
                        </td>
                        <td style="width: 8%">
                            <span>票号</span>
                        </td>
                        <td>
                            <input id="TicketNum" name="TicketNum" class="mini-textbox" width="100%" />
                        </td>
                        <td style="width: 8%">
                            <span>目的地</span>
                        </td>
                        <td colspan="3">
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border: none">
                                <tr>
                                    <td style="width: 30%; border: none">
                                        <input id="DestinationCode" name="DestinationCode" class="mini-autocomplete"
                                            valuefield="CID" textfield="ComInfo" width="100%" popupwidth="200"
                                            url="/GoodsOrderMgr/GoodsOrder/GetDestinationByCode" onvaluechanged="destinationCodeChange" />
                                    </td>
                                    <td style="border: none">
                                        <input id="DestinationName" name="DestinationName" class="mini-textbox" enabled="false" width="100%" />
                                    </td>
                                </tr>
                            </table>

                        </td>
                        <td style="width: 8%">
                            <span>货号</span>
                        </td>
                        <td style="width: auto; text-align: left">
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border: none">
                                <tr>
                                    <td style="width: 30%; border: none">
                                        <input id="GoodsNum_1" name="GoodsNum_1" class="mini-textbox" width="100%" />
                                    </td>
                                    <td style="width: 31%; border: none">
                                        <input id="GoodsNum_2" name="GoodsNum_2" class="mini-textbox" width="100%" />
                                    </td>
                                    <td style="border: none">
                                        <input id="GoodsNum_3" name="GoodsNum_3" class="mini-textbox" width="100%" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>客户代码</span>
                        </td>
                        <td>
                            <input id="ReceiverCode" name="ReceiverCode" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>收货人</span>
                        </td>
                        <td>
                            <input id="ReceiverLinkman" name="ReceiverLinkman" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>电话</span>
                        </td>
                        <td colspan="3">
                            <input id="ReceiverLinkmanTel" name="ReceiverLinkmanTel" class="mini-autocomplete"
                                valuefield="CustomerID" textfield="CustomerInfo" width="100%"
                                url="/GoodsOrderMgr/GoodsOrder/GetCustomerInfo" onvaluechanged="receiverLinkmanTelChange" />
                        </td>
                        <td>
                            <span>地址</span>
                        </td>
                        <td>
                            <input id="ReceiverAddress" name="ReceiverAddress" class="mini-textbox" width="100%" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>客户代码</span>
                        </td>
                        <td>
                            <input id="SenderCode" name="SenderCode" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>发货人</span>
                        </td>
                        <td>
                            <input id="SenderLinkman" name="SenderLinkman" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>电话</span>
                        </td>
                        <td colspan="3">
                            <input id="SenderLinkmanTel" name="SenderLinkmanTel" class="mini-autocomplete"
                                valuefield="CustomerID" textfield="CustomerInfo" width="100%"
                                url="/GoodsOrderMgr/GoodsOrder/GetCustomerInfo" onvaluechanged="senderLinkmanTelChange" />
                        </td>
                        <td>
                            <span>账号</span>
                        </td>
                        <td>
                            <input id="SenderAccount" name="SenderAccount" class="mini-textbox" width="100%" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>卸货地点</span>
                        </td>
                        <td>
                            <input id="EndStationCode" name="EndStationCode" class="mini-hidden" value="" />
                            <input id="EndStationName" name="EndStationName" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>付款方式</span>
                        </td>
                        <td>
                            <input id="FreightType" name="FreightType" class="mini-combobox" textfield="DValue" valuefield="DKey"
                                url="/GoodsOrderMgr/GoodsOrder/GetFreightType" width="100%" />
                        </td>
                        <td>
                            <span>保险金额</span>
                        </td>
                        <td>
                            <input id="InsuranceAmount" name="InsuranceAmount" class="mini-textbox" width="100%" />
                        </td>
                        <td style="width: 50px">
                            <span>保险费</span>
                        </td>
                        <td>
                            <input id="InsuranceFee" name="InsuranceFee" class="mini-textbox" width="100%" />
                        </td>
                        <td>
                            <span>手工单号</span>
                        </td>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border: none">
                                <tr>
                                    <td style="width: 40%; border: none">
                                        <input id="ManualNo_1" name="ManualNo_1" class="mini-textbox" width="100%" />
                                    </td>
                                    <td style="border: none">
                                        <input id="ManualNo_2" name="ManualNo_2" class="mini-textbox" width="100%" />
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>制票时间</span>
                        </td>
                        <td>
                            <input id="TicketMakeDate" name="TicketMakeDate" class="mini-datepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" width="100%" />
                        </td>
                        <td colspan="8" style="border: none"></td>
                    </tr>
                </table>
            </form>
        </div>
        <div style="width: 100%; height: auto">
            <table style="width: 100%; height: 52px" class="orderdetailborder">
                <tr>
                    <td style="width: 100%; height: 100%">
                        <div id="goodgrid" class="mini-datagrid" style="width: 100%; height: 100%" showpager="false"
                            allowcelledit="true" allowcellselect="true" multiselect="true">
                            <div property="columns">
                                <div field="GoodsName" headeralign="center">
                                    货物名称
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Quantity" headeralign="center">
                                    件数
                                 <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="" headeralign="center">
                                    包装样式
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Weight" headeralign="center" align="right">
                                    重量|千克
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Long" headeralign="center" align="right">
                                    长
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Width" headeralign="center" align="right">
                                    宽
                                 <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Height" headeralign="center" align="right">
                                    高
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Volume" headeralign="center" align="right">
                                    体积|立方
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Price" headeralign="center" align="right">
                                    单价
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                                <div field="Amount" headeralign="center" align="right">
                                    运费
                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div style="width: 100%; height: auto;">
            <form id="orderFee" method="post">
                <table id="tbfee" style="width: 100%; height: auto" class="orderfeeborder">
                    <tr>
                        <td>
                            <span>应收费用</span>
                        </td>
                        <td>
                            <input id="AccountsReceivable" name="AccountsReceivable" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>已收费用</span>
                        </td>
                        <td>
                            <input id="Issued" name="Issued" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>货到付费</span>
                        </td>
                        <td>
                            <input id="DeliveryFee" name="DeliveryFee" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>回执付费</span>
                        </td>
                        <td>
                            <input id="ReceiptFee" name="ReceiptFee" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td rowspan="5" style="text-align: left; padding: 0 0 0 10px">
                            <div id="IsReceipt" name="IsReceipt" class="mini-checkbox" text="是否开发票(F7)"></div>
                            <br />
                            <div id="IsOwnLine" name="IsOwnLine" class="mini-checkbox" text="转非专线"></div>
                            <br />
                            <div id="IsFeedBack" name="IsFeedBack" class="mini-checkbox" text="是否回执(F4)"></div>
                            <br />
                            <div id="IsPaidGoodCash" name="IsPaidGoodCash" class="mini-checkbox" text="直接发放:垫付货款"></div>
                            <br />
                            <div id="IsPaidFreight" name="IsPaidFreight" class="mini-checkbox" text="直接发放:垫付运费"></div>
                            <br />
                            <div id="IsPaidOther" name="IsPaidOther" class="mini-checkbox" text="直接发放:其他垫付"></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>垫付货款</span>
                        </td>
                        <td>
                            <input id="PaidGoodFee" name="PaidGoodFee" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>垫付运费</span>
                        </td>
                        <td>
                            <input id="PaidFreight" name="PaidFreight" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>其他垫付</span>
                        <td>
                            <input id="PaidOther" name="PaidOther" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>代收货款</span>
                        </td>
                        <td>
                            <input id="CollectionGoodCash" name="CollectionGoodCash" class="mini-textbox" style="width: 100%;" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>提货方式</span>
                        </td>
                        <td>
                            <input id="ReceiverGetGoodsType" name="ReceiverGetGoodsType" class="mini-combobox"
                                textfield="DValue" valuefield="DKey" style="width: 100%;"
                                url="/GoodsOrderMgr/GoodsOrder/GetReceiverGetGoodsType" />
                        </td>
                        <td>
                            <span>送货预留</span>
                        </td>
                        <td>
                            <input id="DeliveryReserved" name="DeliveryReserved" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>中转预留</span>
                        </td>
                        <td>
                            <input id="TransitReserved" name="TransitReserved" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>落地费</span>
                        </td>
                        <td>
                            <input id="LandingFee" name="LandingFee" class="mini-textbox" style="width: 100%;" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>工本费</span>
                        </td>
                        <td>
                            <input id="BasicCostFee" name="BasicCostFee" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>货到付款</span>
                        </td>
                        <td>
                            <input id="DeliveryCash" name="DeliveryCash" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>开票地点</span>
                        </td>
                        <td>
                            <input id="TicketCreatePlace" name="TicketCreatePlace" class="mini-textbox" style="width: 100%;" />
                        </td>
                        <td>
                            <span>业务员</span>
                        </td>
                        <td>
                            <input id="Salesman" name="Salesman" class="mini-textbox" style="width: 100%;" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span>备注</span>
                        </td>
                        <td colspan="7">
                            <input id="Remark" name="Remark" class="mini-textbox" style="width: 100%;" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <div style="width: 100%; height: auto">
            <table style="width: 100%; height: auto" class="btnborder">
                <tr>
                    <td>
                        <a id="btnok" class="mini-button" iconcls="icon-ok" onclick="">审核</a>&nbsp;&nbsp;&nbsp;
                        <a id="btnclear" class="mini-button" iconcls="icon-new" onclick="clearAll">清空(F8)</a>&nbsp;&nbsp;&nbsp;
                        <a id="btnremove" class="mini-button" iconcls="icon-remove" onclick="remove">删除(P)</a>&nbsp;&nbsp;&nbsp;
                        <a id="btnsearch" class="mini-button" iconcls="icon-search" onclick="query">查询(C)</a>&nbsp;&nbsp;&nbsp;
                        <a id="btnsave" class="mini-button" iconcls="icon-save" onclick="save">保存(S)</a>&nbsp;&nbsp;&nbsp;
                        <a id="btnexit" class="mini-button" iconcls="icon-cancel" onclick="exit">退出(X)</a>&nbsp;&nbsp;&nbsp;
                        @if (ViewBag.IsMax == "0")
                        {
                            <a id="btnzoomin" class="mini-button" iconcls="icon-zoomin" onclick="max">全屏(M)</a>
                        }
                        else
                        {
                            <a id="btnzoomout" class="mini-button" iconcls="icon-zoomout" onclick="min">取消全屏(N)</a>
                        }
                    </td>
                </tr>
            </table>
        </div>
        <div class="mini-fit">
            <table style="width: 100%; height: 100%; border: solid 1px #aaa;">
                <tr style="width: 100%; height: 100%;">
                    <td style="width: 100%; height: 100%;">
                        <div class="mini-toolbar" style="width: auto;">
                            <span>日期范围</span>
                            <input id="querystartdate" class="mini-datepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
                            <span>至</span>
                            <input id="queryenddate" class="mini-datepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
                            <input id="cb1" class="mini-combobox" />
                            <input id="cb2" class="mini-combobox" />
                            <a id="btnqueryorder" class="mini-button" iconcls="icon-search" onclick="queryorder">查询(F3)</a>
                        </div>
                        <div class="mini-fit">
                            <div id="querygrid" class="mini-datagrid" style="width: 100%; height: 100%"
                                allowcelledit="true" allowcellselect="true" multiselect="true" showpager="false">
                                <div property="columns">
                                    <div type="checkcolumn"></div>
                                    <div field="TicketNum" headeralign="center">票号</div>
                                    <div field="GoodsNum" headeralign="center">货号</div>
                                    <div filed="GoodsNum" headeralign="center">手工单号</div>
                                    <div field="GoodsNum" headeralign="center">开票日期</div>
                                    <div field="GoodsNum" headeralign="center">时间</div>
                                    <div field="GoodsNum" headeralign="center">发货地点</div>
                                    <div field="GoodsNum" headeralign="center">到货公司</div>
                                    <div field="GoodsNum" headeralign="center">卸货地点</div>
                                    <div field="GoodsNum" headeralign="center">货物名称</div>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    mini.parse();

    var ismax = "@ViewBag.IsMax";

    //<!--第一种方案:直接取出赋值在前台-->
    //top.mini.mask({ cls: "mini-mask-loading", html: "正在加载..." });

    //$.ajax({
    //    url: "/GoodsOrderMgr/GoodsOrder/GetAllIntiData",
    //    dataType: "json",
    //    data: {},
    //    success: function (e) {
    //        top.mini.unmask();
    //    },
    //    error: function (XMLHttpRequest, textStatus, errorThrown) {
    //        //mini.hideMessageBox(maskid);
    //        top.mini.unmask();
    //        hidddenAllOption();
    //    }
    //});
    //<!---->

    function hidddenAllOption() {
        mini.get("btnok").setEnabled(false);
        mini.get("btnclear").setEnabled(false);
        mini.get("btnremove").setEnabled(false);
        mini.get("btnsearch").setEnabled(false);
        mini.get("btnsave").setEnabled(false);
        mini.get("btnexit").setEnabled(false);
        if (ismax == "0") {
            mini.get("btnzoomin").setEnabled(false);
        } else {
            mini.get("btnzoomout").setEnabled(false);
        }
        mini.get("btnqueryorder").setEnabled(false);
    }

    document.onkeydown = keydown;

    function keydown(e) {
        e = e || event;
        var keycode;
        if (window.ActiveXObject) {
            keycode = e.keyCode; //IE
        } else {
            keycode = e.which;//Firefox
        }
        switch (keycode) {
            case 67: { if (event.altKey) { event.returnValue = false; query(); } break; }//C
            case 77: { if ((ismax == "0") && (event.altKey)) { event.returnValue = false; max(); } break; }//M
            case 78: { if ((ismax == "1") && (event.altKey)) { event.returnValue = false; min(); } break; }//N
            case 80: { if (event.altKey) { event.returnValue = false; remove() } break; };//P
            case 83: { if (event.altKey) { event.returnValue = false; save(); } break; }//S
            case 88: { if (event.altKey) { event.returnValue = false; exit(); } break; }//X
            case 114: { event.returnValue = false; queryorder(); break; }//F3
            case 115: { event.returnValue = false; mini.get("IsFeedBack").setChecked(!mini.get("IsFeedBack").getChecked()); break; }//F4
            case 118: { event.returnValue = false; mini.get("IsReceipt").setChecked(!mini.get("IsReceipt").getChecked()); break; }//F7
            case 119: { event.returnValue = false; clearAll(); break; }//F8
            default: break;
        }
    }

    var goodgrid = mini.get("goodgrid");
    var initRow = {};
    goodgrid.addRow(initRow);

    function destinationCodeChange(e) {
        var item = e.selected;
        mini.get("DestinationCode").setValue(item.MiniCode);
        mini.get("DestinationCode").setText(item.MiniCode);

        mini.get("DestinationName").setValue(item.CName);

        mini.get("Destination").setValue(item.CID);
        mini.get("EndStationCode").setValue(item.MiniCode);
        mini.get("EndStationName").setValue(item.CName);
    }

    function receiverLinkmanTelChange(e) {
        var item = e.selected;
        mini.get("ReceiverLinkmanTel").setValue(item.CPhoneNum);
        mini.get("ReceiverLinkmanTel").setText(item.CPhoneNum);

        mini.get("ReceiverLinkman").setValue(item.CustomerName);

        mini.get("ReceiverCode").setValue(item.CustomerCode);
        mini.get("ReceiverID").setValue(item.CustomerID);

        mini.get("ReceiverAddress").setValue(item.CAddress);
    }

    function senderLinkmanTelChange(e) {
        var item = e.selected;
        mini.get("SenderLinkmanTel").setValue(item.CPhoneNum);
        mini.get("SenderLinkmanTel").setText(item.CPhoneNum);

        mini.get("SenderLinkman").setValue(item.CustomerName);

        mini.get("SenderCode").setValue(item.CustomerCode);
        mini.get("SenderID").setValue(item.CustomerID);

        mini.get("SenderAddress").setValue(item.CAddress);
    }

    function clearAll() {
        top.mini.showTips({ content: "This is F8", state: "info", x: "center", y: "center", timeout: 1000 });
    }

    function remove() {
        //top.mini.showTips({ content: "This is Alt + P", state: "info", x: "center", y: "center", timeout: 1000 });
        mini.open({
            url: "/GoodsOrderMgr/GoodsOrder/DeleteOrder",
            title: "删除订单",
            width: "80%",
            height: "85%",
            allowResize: false,
            onload: function () {
            },
            ondestroy: function (action) {
            }
        });
    }

    function query() {
        top.mini.showTips({ content: "This is Alt + C", state: "info", x: "center", y: "center", timeout: 1000 });
    }

    function save() {
        mini.get("btnsave").setEnabled(false);
        //top.mini.showTips({ content: "This is Alt + S", state: "info", x: "center", y: "center", timeout: 1000 });
        var orderMain = new mini.Form("orderMain");
        var orderMainData = orderMain.getData();
        orderMainData._state = "modified";
        orderMainData = mini.encode([orderMainData]);

        var orderFee = new mini.Form("orderFee");
        var orderFeeData = orderFee.getData();
        orderFeeData._state = "modified";
        orderFeeData = mini.encode([orderFeeData]);

        var goodgrid = mini.get("goodgrid");
        var goodgridData = goodgrid.getData();

        for (var i = 0, l = goodgridData.length; i < l; i++) {
            goodgridData._state = "modified";
        }

        goodgridData = mini.encode(goodgridData);

        top.mini.mask({ cls: "mini-mask-loading", html: "正在保存..." });

        $.ajax({
            url: "/GoodsOrderMgr/GoodsOrder/SaveGoodsOrder",
            type: "post",
            data:
            {
                orderMainData: orderMainData, orderFeeData: orderFeeData, goodgridData: goodgridData
            },
            success: function (text, flag, res) {
                top.mini.unmask();
                var responseText = mini.decode(res.responseText);
                if (responseText["SaveMsg"] == "") {
                    mini.get("OrderID").setValue(responseText["OrderID"]);
                    mini.get("ReceiverID").setValue(responseText["ReceiverID"]);
                    mini.get("ReceiverCode").setValue(responseText["ReceiverCode"]);
                    mini.get("SenderID").setValue(responseText["SenderID"]);
                    mini.get("SenderCode").setValue(responseText["SenderCode"]);

                    top.mini.showTips({ content: "保存成功", state: "success", x: "center", y: "center", timeout: 2000 });
                } else {
                    top.mini.showTips({ content: "保存失败", state: "danger", x: "center", y: "center", timeout: 2000 });
                }
                mini.get("btnsave").setEnabled(true);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                top.mini.unmask();
                top.mini.showTips({ content: "保存失败", state: "danger", x: "center", y: "center", timeout: 2000 });
                mini.get("btnsave").setEnabled(true);
            }
        });

    }

    function exit() {
        //top.mini.showTips({ content: "This is Alt + X", state: "info", x: "center", y: "center", timeout: 1000 });
        var tabs = window.Owner.getTabs();
        tabs.removeTab(tabs.getActiveTab());
    }

    function max() {
        var tabs = window.Owner.getTabs();
        //tabs.removeTab(tabs.getActiveTab());
        var win = mini.open({
            url: tabs.getActiveTab().url + "?isMax=1",
            onload: function () { },
            ondestroy: function (action) {
            }
        });

        win.max();
    }

    function min() {
        window.CloseOwnerWindow();
    }

    function queryorder() {
        top.mini.showTips({ content: "This is F3", state: "info", x: "center", y: "center", timeout: 1000 });
    }

</script>
